<template>
  <el-menu
    default-active="2"
    class="el-menu-vertical-demo"
    background-color="#545c64"
    text-color="#fff"
    unique-opened
    active-text-color="#ffd04b"
    :collapse-transition="false"
    :collapse="collapse"
    router
    
  >
     <!-- 将当前组件的menus属性的值传给 NavbarItem组件的menus属性 -->
    <NavbarItem :menus="menus" :collapse="collapse"></NavbarItem>
   
  </el-menu>
</template>
 
<script> 
   
  //引入 NavbarItem.vue"组件
  import NavbarItem from "./NavbarItem.vue"
export default {
  props: {
    menus: {
      type: Array,
      require: true, 
    },
    collapse:{
      type:Boolean,
      default:false
    }
  },
  components:{
    NavbarItem:NavbarItem
  }
};
</script>

<style scoped>
   .el-menu{
     height: 100%;
     
   }
   
</style>
